import demo.ListNode;

import java.lang.reflect.Array;
import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LIUYANJIAO
 * Date: 2024-05-29
 * Time: 21:42
 */
public class Main {

    public static int[] twoSum(int[] nums, int target) {
        int[] arr=new int[2];
        for(int i=0;i<nums.length;i++){
            for(int j=i+1;j<nums.length;j++){
                if (nums[i]+nums[j]==target){
                    arr[0]=i;
                    arr[1]=j;
                    return arr;
                }
            }
        }
        return null;
    }
    public static void main1(String[] args) {
      int nums[]={3,2,4};
      int arr[]=twoSum(nums,6);
        System.out.println(Arrays.toString(arr));
    }
}